<template>
  <!-- 选购指南 -->
  <view class="box p20">
    <view class="title c3 fs28 df aic mb20">
      <view class="title-icon mr10"></view>商品规格
    </view>
    <view
      class="sku-item mt20 df aic jcsb"
      v-for="(item, index) in platformGoodsSpecMix"
      :key="index"
    >
      <view class="df aic">
        <u-image
          style="margin-right: 20rpx"
          border-radius="10"
          width="96rpx"
          :src="item.image && item.image.split(',')[0]"
          height="96rpx"
        ></u-image>
        <view class="">
          <view class="fs26">规格：{{ item.specName }}</view>
          <view
            class="df aic price mt10"
            v-if="item.referencePrice && item.referencePrice != '0.00' && TOKEN"
          >
            <text class="fs24">单价：</text
            ><text class="fs26"
              >{{ item.referencePrice }}元/{{ item.referenceUnit }}</text
            >
          </view>
          <view class="mt8 fs24" v-if="TOKEN"
            >售价：<Vip class="mr5" v-if="item.isMemberPrice == 1"></Vip>
            <text class="price fs30 mr5">¥{{ item.platformPrice || 0 }}</text>
            <text v-if="item.isMemberPrice == 1" class="text-under c9 fs24"
              >原价:¥{{ item.memberLevel0Price || 0 }}
            </text>
			<text v-if="item.busType == 1" class="text-under c9 fs24"
			  >原价:¥{{ item.initPlatformPrice || 0 }}
			</text>
			
          </view>
          <view class="mt8 fs24" v-else>
            <text class="price fs30 mr5">登录可见价格</text></view
          >
        </view>
      </view>
      <!-- 专题 -->
      <view class="" v-if="source == 'theme'">
        <zm-number-box
          :saleUnit="item.saleUnit"
          :startSaleNum="item.startSaleNum"
          :step="
            item.startSaleNum && item.isDouble == 1 ? item.startSaleNum : 1
          "
          :disabledInput="item.isDouble == 1"
          v-if="TOKEN"
          size="40"
          @change="valChange($event, index)"
          :min="0"
          v-model="item.purNum"
        ></zm-number-box>
        <nmr-icon
          v-else
          @click.stop="handleLogin"
          name="jiatianjia-yuankuang"
          size="40"
          color="#47A848"
        ></nmr-icon>
      </view>
      <!-- 正常 -->
      <view class="" v-else>
        <view class="" v-if="$common.calcTime(info.startTime, info.endTime)">
          <zm-number-box
            :saleUnit="item.saleUnit"
            :startSaleNum="item.startSaleNum"
            :step="
              item.startSaleNum && item.isDouble == 1 ? item.startSaleNum : 1
            "
            :disabledInput="item.isDouble == 1"
            v-if="TOKEN"
            size="40"
            @change="valChange($event, index)"
            :min="0"
            v-model="item.purNum"
          ></zm-number-box>
          <nmr-icon
            v-else
            @click.stop="handleLogin"
            name="jiatianjia-yuankuang"
            size="40"
            color="#47A848"
          ></nmr-icon>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: ["platformGoodsSpecMix", "info", "source"],

  data() {
    return {};
  },
  methods: {
    valChange(e, index) {
      this.$emit("valChange", e, index);
    },
    handleLogin() {
      this.$emit("handleLogin");
    },
  },
};
</script>

<style lang="scss" scoped>
.sku-item {
  background: #f1f1f1;
  border-radius: 20rpx 20rpx 20rpx 20rpx;
  padding: 25rpx 20rpx;
}

.box {
  border-radius: 20rpx;
  margin: 20rpx 30rpx;
  background-color: white;
  font-size: 24rpx;
  font-family: PingFangSC-Regular-, PingFangSC-Regular;
  font-weight: normal;

  .item {
    border-bottom: 2rpx solid #e5e5e5;
    padding: 20rpx;

    &:last-child {
      border-bottom: 0;
      padding-bottom: 0;
    }
  }

  .title {
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: bold;

    .title-icon {
      width: 6rpx;
      height: 30rpx;
      background: #47a848;
      border-radius: 3rpx 3rpx 3rpx 3rpx;
    }

    margin-bottom: 0;
  }

  .desc {
    color: #666666;
  }

  .value {
    color: #333333;
  }
}
</style>
